<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // for , while , do while , for of , for in , forEach
        var num = 0;
        //while-->while(true){}-->浏览器崩溃
        //当判断条件成立的时候才会执行大括号里的代码
        // while(num < 5){
        //     console.log("代码执行了",num);

        //     num = num + 1;
        // }
        
        //do while
        // do {
        //     console.log("执行",num);
        //     num = num + 1;
        // }while(num < 5)

        //for

        // for(var i =0; i < 10; i = i + 1){
        //     console.log("执行",i)
        // }

        // var arr = [10,100,1000,10000,100000]

        // for(var i =0;i < arr.length;i =i + 1){
        //     console.log(i);
        //     console.log("执行",i);
        //     console.log(arr[i]);
        // }
        //for in 
        var obj = {
            name:'tom',
            age:16,
            money:100000000
        }
        console.log(obj.name);
        console.log(obj.age);
        console.log(obj.money);

        for(var key in obj){
            console.log(obj[key]);
            // console.log(key)
        }

        //for of

        //forEach

    </script>
</body>
</html>